package org.btik.light.tool.type;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;

/**
 * 集合工具
 */
public class CollectionUtil {

    public static boolean isEmpty(Collection<?> collection) {
        return null == collection || collection.isEmpty();
    }

    public static boolean isNotEmpty(Collection<?> collection) {
        return null != collection && !collection.isEmpty();
    }

    public static <T> ArrayList<T> asArrayList(T ... elements){
        ArrayList<T> list = new ArrayList<>(elements.length);
        Collections.addAll(list, elements);
        return list;
    }

}
